package com.ctd.springframework.util;

import java.util.Objects;

/**
 * Assert
 *
 * @author chentudong
 * @time 2019/3/24 14:56
 */
public abstract class Assert {
    /**
     * object is not null
     *
     * @param object  object
     * @param message throwMessage
     */
    public static void notNull(Object object, String message) {
        if (Objects.isNull(object)) {
            throw new IllegalArgumentException(message);
        }
    }

    public static void hasText(String text, String message) {
        if (!StringUtils.hasText(text)) {
            throw new IllegalArgumentException(message);
        }
    }
}
